﻿@{
    ViewBag.Title = "SysIndex";
    Layout = "~/Views/Shared/_Index.cshtml";
}
<script>
    $(function () {
        gridList();
    })
    function gridList() {
        var $gridList = $("#gridList");
        $gridList.dataGrid({
            url: "/BusinessManage/D_AmountChange/GetAllGridJson",
            height: $(window).height() - 128,
            colModel: [
                { label: "主键", name: "F_Id", hidden: true, key: true },
                { label: '会员姓名', name: 'F_AccountName', width: 80, align: 'center' },
                { label: '单据号', name: 'F_No', width: 150, align: 'left' },
                { label: '提现金额', name: 'F_Money', width: 80, align: 'right', halign: 'center' },
                {
                    label: '提现时间', name: 'F_CreatorTime', width: 140, align: 'center',
                    formatter: "date", formatoptions: { srcformat: 'Y-m-d H:i:s', newformat: 'Y-m-d H:i:s' }
                },
                {
                    label: "状态", name: "F_State", width: 60, align: "center",
                    formatter: function (cellvalue) {
                        if (cellvalue == 1) {
                            return '<span class=\"label label-success\">已审核</span>';
                        } else if (cellvalue == 0) {
                            return '<span class=\"label label-default\">未审核</span>';
                        }
                    }
                }
            ],
            pager: "#gridPager",
            sortname: 'F_CreatorTime desc',
            viewrecords: true
        });
        $("#btn_search").click(function () {
            $gridList.jqGrid('setGridParam', {
                postData: { keyword: $("#txt_keyword").val() },
            }).trigger('reloadGrid');
        });
    }
    function btn_edit() {
        var keyValue = $("#gridList").jqGridRowValue().F_Id;
        $.modalOpen({
            id: "Form",
            title: "审核提现申请",
            url: "/BusinessManage/D_AmountChange/SysForm?keyValue=" + keyValue,
            width: "450px",
            height: "400px",
            callBack: function (iframeId) {
                top.frames[iframeId].submitForm();
            }
        });
    }
</script>

<div class="topPanel">
    <div class="search">
        <table>
            <tr>
                <td>
                    <div class="input-group">
                        <input id="txt_keyword" type="text" class="form-control" placeholder="会员姓名" style="width: 200px;">
                        <span class="input-group-btn">
                            <button id="btn_search" type="button" class="btn  btn-primary"><i class="fa fa-search"></i></button>
                        </span>
                    </div>
                </td>
            </tr>
        </table>
    </div>
    <div class="toolbar">
        <div class="btn-group">
            <a class="btn btn-primary" onclick="$.reload()"><span class="glyphicon glyphicon-refresh"></span></a>
        </div>
        <div class="operate">
            <ul class="nav nav-pills">
                <li class="first">已选中<span>1</span>项</li>
                <li><a id="NF-edit" authorize="yes" onclick="btn_edit()"><i class="fa fa-pencil-square-o"></i>审核提现申请</a></li>
            </ul>
            <a href="javascript:;" class="close"></a>
        </div>
        <script>$('.toolbar').authorizeButton()</script>
    </div>
</div>
<div class="gridPanel">
    <table id="gridList"></table>
    <div id="gridPager"></div>
</div>
